<template>
  <div class="tool-bar-ri">
    <div class="header-icon">
      <FondsTree />
      <el-tooltip class="box-item" effect="dark" content="组件尺寸" placement="top">
        <AssemblySize id="assemblySize" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="切换语言" placement="top">
        <Language id="language" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="搜索菜单" placement="top">
        <SearchMenu id="searchMenu" />
      </el-tooltip>
      <UrlBorrow id="urlBorrow" />
      <el-tooltip class="box-item" effect="dark" content="打包下载" placement="top">
        <Download id="download" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="系统设置" placement="top">
        <ThemeSetting id="themeSetting" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="通知栏信息" placement="top">
        <Message id="message" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="全屏" placement="top">
        <Fullscreen id="fullscreen" />
      </el-tooltip>
      <el-tooltip class="box-item" effect="dark" content="锁屏" placement="top">
        <!-- <LockScreen id="Lockscreen" /> -->
        <el-icon size="21" style="cursor: pointer" @click="lockscreenStore.setLock(true)"><Lock /></el-icon>
      </el-tooltip>
    </div>
    <span class="username">{{ username }}</span>
    <Avatar />
  </div>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { useUserStore } from "@/stores/modules/user";
import { useLocksSreenStore } from "@/stores/modules/lockscreen";
import FondsTree from "./components/FondsTree.vue";
import AssemblySize from "./components/AssemblySize.vue";
import Language from "./components/Language.vue";
import SearchMenu from "./components/SearchMenu.vue";
import UrlBorrow from "./components/UrlBorrow.vue";
import ThemeSetting from "./components/ThemeSetting.vue";
import Message from "./components/Message.vue";
import Fullscreen from "./components/Fullscreen.vue";
import Avatar from "./components/Avatar.vue";
import Download from "./components/Download.vue";

// pinia
const userStore = useUserStore();
const lockscreenStore = useLocksSreenStore();
const username = computed(() => userStore.userInfo.U_Name);
</script>

<style scoped lang="scss">
.tool-bar-ri {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 25px;
  .header-icon {
    display: flex;
    align-items: center;
    & > * {
      margin-left: 21px;
      color: var(--el-header-text-color);
    }
  }
  .username {
    margin: 0 20px;
    font-size: 15px;
    color: var(--el-header-text-color);
  }
}
</style>
